#include "Base.h"
#include "Derive1.h"
#include "Derive2.h"
#include <iostream>
using namespace std;

int main(int argc, char * argv[])
{
  cout << "---A" << endl;
  Base * bobj1 = new Base;
  cout << "---B" << endl;
  Derive1 * dobj1 = new Derive1;
  cout << "---C" << endl;
  Derive1 * dobj2 = new Derive2;
  cout << "---D" << endl;
  // objects must be explicitly destroyed
  delete bobj1;
  cout << "---E" << endl;
  delete dobj1;
  cout << "---F" << endl;
  delete dobj2;
  return 0;
}

/*
 * check memory leak:
 *
 * valgrind --leak-check=yes ./cpp
 */


